home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 005 / solrheat.bas (.txt) < prev    next >
Encoding:
GW-BASIC  |  1985-01-26  |  5.3 KB  |  70 lines

  1. 10  CLS:COUNTER = 1
  2. 20  PRINT :PRINT:PRINT:PRINT:PRINT TAB(30)"PROGRAM TO CALCULATE HOT WATER":PRINT:PRINT TAB(23)" AND HEATING POTENTIAL SAVINGS BY ADDING":PRINT:PRINT TAB(35)"SOLAR ENERGY DEVICES"
  3. 30  PRINT:PRINT:PRINT TAB(35)"BY:  RAY L. HOCKSTAD":PRINT TAB(35)"1614 SO. 15TH. ST.":PRINT TAB(35)"ESCANABA, MI  49829"
  4. 40  PRINT:PRINT:PRINT:PRINT"Simply follow the prompts and enter the figures requested by the program.":PRINT"Please only enter whole numbers and %'s, not decimals.":PRINT
  5. 50  TMSH=0:TMSW=0:TT=O:TI=0:ZZ=0:ZI=0
  6. 100  PRINT:INPUT"Enter the total cost of the installation ---------------";C
  7. 110  INPUT"Enter your estimated yearly inflation rate --------------";IR:IR=IR/100
  8. 120  INPUT"Enter the interest rate you expect to earn on savings --";I
  9. 130  INPUT"Enter your State tax savings (c/r if none) -------------";SS
  10. 140  INPUT"Enter your Fedral energy tax credits (c/r if none) -----";FS
  11. 150  INPUT"Enter your Federal tax bracket -------------------------";TB:TB=(100-TB)/100
  12. 155  PRINT:PRINT:INPUT"If you have a printer, turn it on and enter `1', if not enter a `2'.";QU
  13. 156  IF QU = 1 THEN GOTO 160 ELSE 180
  14. 160  LPRINT TAB(20)"PROGRAM TO DEMONSTRATE POSSIBLE SOLAR HEAT SAVINGS":LPRINT" ":LPRINT" ":LPRINT TAB(36)"Total Cost -----$"C:LPRINT TAB(36)"Tax Savings ----$"FS+SS:LPRINT TAB(36)"Savings acct. Int. -"I"%":LPRINT TAB(36)"Inflation Rate -"IR*100"%"
  15. 170  LPRINT TAB(36)"Tax Bracket ----"100-(TB*100)"%"
  16. 180  TS=FS+SS
  17. 190  AC=C-TS
  18. 200  CLS:PRINT"Now I will calculate the month by month savings of both the solar heat and, if  applicable, the solar hot water."
  19. 210  INPUT"Enter your previous years (or average of a # of years) total heat costs for the six (6) month period of November through April.";WH:AWH=WH/6
  20. 220  INPUT"Enter your same total heat costs for the six (6) month period of May through October.";SH:ASH=SH/6
  21. 230  INPUT"Enter your total hot water costs for the previous year (or average of a # of years).";HC:AHC=HC/12
  22. 240  INPUT"Enter your estimated solar heat savings as a % .";S:HS=S/100
  23. 250  INPUT"Enter your estimated solar hot water savings as a %.";WS:WS=WS/100
  24. 260  INPUT"Enter the month that your solar energy system will begin working (3,7,10,etc.).";SM:SM2=SM
  25. 270  INPUT"Enter the year it will be starting (1985).";Y:Y2=Y
  26. 298  IF QU =1 THEN 300 ELSE 320
  27. 300  LPRINT TAB(23)"Previous yearly heating costs ---";:LPRINT USING"$$#,###.##";WH+SH:LPRINT TAB(23)"Previous yearly hot water costs -";:LPRINT USING"$$#,###.##";HC
  28. 310  LPRINT" ":LPRINT TAB(23)"EST. SOLAR SAVINGS --"HS*100"%";:LPRINT TAB(23)"EST. HOT WATER SAVINGS --"WS*100"%":LPRINT" ":LPRINT" "
  29. 320  GOSUB 1000
  30. 330  IF TT=0 THEN GOTO 340 ELSE IF SM = 13 THEN SM =1:Y=Y+1:AWH=AWH+(AWH*IR):ASH=ASH+(ASH*IR):AHC=AHC+(AHC*IR)
  31. 340  IF SM=11 OR SM=12 OR SM=1 OR SM=2 OR SM =3 OR SM = 4 THEN AA = AWH ELSE AA = ASH
  32. 350  MSH=AA*HS
  33. 360  TMSH=TMSH+MSH
  34. 370  WMS=AHC*WS
  35. 380  TWMS=TWMS+WMS:TT=TT+1
  36. 390  IF TT >4 THEN 400 ELSE IF QU =1 THEN 410 ELSE 400
  37. 400  ZZ2=ZZ-TI:IF QU =1 AND ZZ2=>AC-400 THEN 410 ELSE 440
  38. 410  LPRINT SM;:LPRINT"/"Y;:LPRINT TAB(11)"HEAT SAVINGS THIS MONTH";:LPRINT USING"$$##.##";MSH:LPRINT TAB(11)"HOT WATER SAVINGS THIS MONTH";:LPRINT USING"$$###.##";WMS:LPRINT TAB(11)"TOTAL HEAT SAVINGS FROM"SM2"/"Y2" --";:LPRINT USING"$$###0##";TMSH
  39. 420  LPRINT TAB(11)"TOTAL HOT WATER SAVINGS --";:LPRINT USING"$$###.##";TWMS:LPRINT TAB(11)"TOTAL SAVINGS FROM"SM2"/"Y2"(EXCLUDING ANY INTEREST LOST)--";:LPRINT USING"$$###.##";TMSH+TWMS
  40. 430  LPRINT TAB(11)"SAVINGS MINUS INTEREST LOST (ON PRINC."P")--";:LPRINT USING"$$####.##";TMSH+TWMS-TI:IF TT=1 THEN ZZ=TMSH+TWMS
  41. 440  IF TT>1 THEN ZI=ZZ*((I/100)/12):ZI=ZI*TB:ZZ=ZZ+MSH+WMS+ZI
  42. 441  IF TT>4 AND ZZ2<AC-400 THEN PRINT"WORKING - ";
  43. 442  IF TMSH+TWMS => AC AND COUNTER = 1 THEN GOSUB 1100
  44. 450  IF QU = 1 AND TT < 5 OR ZZ2 =>AC-400 THEN 460 ELSE 470
  45. 460  IF TT > 1 AND QU =1 THEN LPRINT TAB(11)"TRUE SAVINGS (SAVINGS MINUS ANY INTEREST POTENTIALLY LOST ON PURCHASE DOLLARS   PLUS INTEREST EARNED ON SAVINGS AS ACCUMULATED) --";:LPRINT USING"$$#,###.##";ZZ-TI:LPRINT " "
  46. 470  IF ZZ-TI => AC THEN 500 ELSE SM=SM+1:GOTO 320
  47. 500  IF QU = 1 THEN 510 ELSE 600
  48. 510  CLS:LPRINT:LPRINT:LPRINT TAB(5)"In the final analysis, with the figures you have give as shown above, the following results are computed for a pay-back on your solar heat investment:"
  49. 512  LPRINT TAB(15)"1-Figuring only the cash saved each month and yearly fuel price increases of"IR*100;
  50. 513  LPRINT"percent, with no regard as to investing the money otherwise spent on the solar  system, the system will pay for itself";
  51. 514  LPRINT"in"Y1-Y2"Years and"SM1-SM2"Months !!!!
  52. 520  LPRINT TAB(15)"2-Figuring the cash saved each month and yearly fuel price increases of"IR*100"percent, and considering the interest lost by not investing the money in something else that was spent on the solar heat,";
  53. 522  LPRINT"the system will pay for itself in"Y-Y2"Years and"SM-SM2"Months !!!"
  54. 600  CLS:PRINT:PRINT:PRINT TAB(5)"In the final analysis, with the figures you have give as shown above, the following results are computed for a pay-back on your solar heat investment:"
  55. 610  PRINT TAB(15)"1-Figuring only the cash saved each month and yearly fuel price increases of"IR*100"percent, that is with no regard to investing or putting into savings the money otherwise spent on the solar heat, the system will pay for itself";
  56. 612  PRINT"in"Y1-Y2"Years and"SM1-SM2"Months !!!!
  57. 620  PRINT TAB(15)"2-Figuring the cash saved each month and yearly fuel price increases of"IR*100"percent, and considering the interest lost by not investing the money in something else that was spent on the solar heat,";
  58. 622  PRINT"the system will pay for itself in"Y-Y2"Years and"SM-SM2"Months !!!"
  59. 630  GOTO 700
  60. 700  PRINT:PRINT:PRINT"If you want to run another analysis, type `Y', if not type`n'.":INPUT ANOTHER$:IF ANOTHER$ = "Y" OR ANOTHER$ = "y" THEN GOTO 10 ELSE END
  61. 1000  '      COMPOUNDED INTERESTED + PRINC. OVER X MONTHS
  62. 1010  IF TT=0 THEN P = AC
  63. 1020  AI = P*((I/100)/12):AI=AI*TB
  64. 1030  TI=TI+AI
  65. 1040  P=P+AI
  66. 1050  RETURN
  67. 1100  Y1=Y:SM1=SM
  68. 1104  COUNTER = 2
  69. 1110  RETURN
  70.